package com.rran.study.designpattern.factory.factorymethod.simplefactory;

/**
 * @author yy
 * @Type SimpleFactory.java
 * @Desc
 * @date 2020/7/22 15:49
 */
public class SimpleFactory {

    public static Food getFood(String name) {
        if ("noodle".equals(name)) {
            return new Noodle();
        }else if("Meal".equals(name)){
            return new Meal();
        }else if ("apple".equals(name)){
            return new Apple();
        }
        return null;
    }

}
